#ifndef WEBCAMWIDGET_H
#define WEBCAMWIDGET_H

#include <QtOpenGL/QGLWidget>
#include <QtOpenGL/QGLShader>
#include <QtOpenGL/QGLShaderProgram>

#include <QtGui/QMessageBox>

#include <QMap>

#include "Webcam.h"
#include "Effect.h"
#include "EffectListParser.h"
#include "Settings.h"
#include "EffectLoader.h"

class WebcamWidget : public QGLWidget
{
Q_OBJECT

public:
	WebcamWidget(QWidget* parent);
	~WebcamWidget();

	void setWebcam(const Webcam* webcam);

protected:
	virtual void initializeGL();
	virtual void paintGL();

private:
	const Webcam* m_webcam;

	GLuint m_textureId;
	bool m_shadersSupported;

	float m_timerFreq;
	float m_timerStart;
	float m_timerLast;
	float m_timerCurr;

public slots:
	void sliderMoved(int value);
	void buttonPressed(QAbstractButton*);
	void buttonPressed();
};

#endif
